home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / allowo1g / domhtml.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-08-27  |  2.5 KB  |  78 lines

  1. VERSION 5.00
  2. Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
  3. Begin VB.Form frmDOMHTML 
  4.    BackColor       =   &H00FFFFFF&
  5.    Caption         =   "DOM HTML"
  6.    ClientHeight    =   4215
  7.    ClientLeft      =   60
  8.    ClientTop       =   630
  9.    ClientWidth     =   5910
  10.    LinkTopic       =   "Form1"
  11.    MDIChild        =   -1  'True
  12.    ScaleHeight     =   4215
  13.    ScaleWidth      =   5910
  14.    Visible         =   0   'False
  15.    Begin RichTextLib.RichTextBox rtf 
  16.       Height          =   735
  17.       Left            =   600
  18.       TabIndex        =   0
  19.       Top             =   300
  20.       Width           =   1515
  21.       _ExtentX        =   2672
  22.       _ExtentY        =   1296
  23.       _Version        =   393217
  24.       BorderStyle     =   0
  25.       ScrollBars      =   3
  26.       Appearance      =   0
  27.       TextRTF         =   $"DOMHTML.frx":0000
  28.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  29.          Name            =   "Verdana"
  30.          Size            =   9
  31.          Charset         =   0
  32.          Weight          =   400
  33.          Underline       =   0   'False
  34.          Italic          =   0   'False
  35.          Strikethrough   =   0   'False
  36.       EndProperty
  37.    End
  38.    Begin VB.Menu mnuFileMenu 
  39.       Caption         =   "&File"
  40.       Begin VB.Menu mnuFileClose 
  41.          Caption         =   "Close"
  42.       End
  43.    End
  44. Attribute VB_Name = "frmDOMHTML"
  45. Attribute VB_GlobalNameSpace = False
  46. Attribute VB_Creatable = False
  47. Attribute VB_PredeclaredId = True
  48. Attribute VB_Exposed = False
  49. Option Explicit
  50. ' DOMHTML.frm   July 1999   contact markb@orionstudios.com
  51. ' Displays document HTML in a RichTextBox (a TextBox has limited capacity)
  52. ' Requires Project/References entry for
  53. '   Microsoft HTML Object Library (MSHTML.tlb)
  54. '====================================================================================
  55. Private Const MARGIN = 90   ' Twips
  56. Public Sub DisplayHTML(HTMLDoc As MSHTML.HTMLDocument)
  57.     On Error GoTo DisplayHTML_Error
  58.     Dim oHTML As MSHTML.HTMLHtmlElement
  59.     With HTMLDoc
  60.         Me.Caption = .Title
  61.         Set oHTML = .getElementsByTagName("HTML")(0)
  62.     End With
  63.     rtf = oHTML.outerHTML
  64. DisplayHTML_Exit:
  65.     rtf.Visible = True
  66.     Exit Sub
  67. DisplayHTML_Error:
  68.     rtf = "ERROR: " & Err.Number & " - " & Err.Description
  69.     Resume DisplayHTML_Exit
  70. End Sub
  71. Private Sub Form_Resize()
  72.     On Error Resume Next
  73.     rtf.Move MARGIN, 0, Me.ScaleWidth - MARGIN, Me.ScaleHeight
  74. End Sub
  75. Private Sub mnuFileClose_Click()
  76.     Unload Me
  77. End Sub
  78.